#include <iostream>
#include "email.h"

int main() {
  std::string username = "root";
  std::string password = "123456";
  TOB::Email em(1 << 24 | 127, username, password);

  // Read letter list
  uint32 id = 0;
  std::string header;
  Code::Type code;
  while((code = em.getNextSubject(id, header)) == Code::Okay) {
    std::cout << header << std::endl << std::endl;
    ++id;
  }
  std::cout << "returned:" << code << std::endl;

  // Read first letter
  std::string body;
  std::cout << "reading:" << em.readLetter(0, body) << std::endl;
  std::cout << body << std::endl;

	return 0;
}
